from matplotlib import pyplot as plt
import numpy as np
import math


def sigmoid(x):
    return 1.0 / (1 + np.exp(-x))


nums = np.arange(-10, 10, 1)
fig, ax = plt.subplots(figsize=(12, 4))  # 绘制子图
ax.plot(nums, sigmoid(nums), 'r')  # 绘制sigmoid的函数图像
plt.show()